﻿using System;
using System.Diagnostics.Contracts;

namespace UnitOfWork.Interfaces
{
	[ContractClass(typeof(UnitOfWorkFactoryContract))]
	public interface IUnitOfWorkFactory
	{
		IUnitOfWork StartNew();
	}

	[ContractClassFor(typeof(IUnitOfWorkFactory))]
	public abstract class UnitOfWorkFactoryContract : IUnitOfWorkFactory
	{
		public IUnitOfWork StartNew()
		{
			Contract.Ensures(Contract.Result<IUnitOfWork>() != null);
			throw new NotSupportedException();
		}
	}
}